import { defineNuxtRouteMiddleware } from '#app'

export default defineNuxtRouteMiddleware((to, from) => {
  const { hasToken } = useCommonPlugin()
  // 如果服务端渲染直接跳过
  if (process.server) return
  if (!hasToken()) return navigateTo('/sso/login')
})
